package com.mt.util;

/**
 * @ClassNameSwapUtil
 * @Description
 * @Author
 * @Date2021/7/3 上午10:21
 * @Version V1.0
 **/
public class SwapUtil {
    /**
     * 交换元素
     * @param arr
     * @param x
     * @param y
     */
    public static void swap(int[] arr,int x,int y){
        arr[x] = arr[x]^arr[y];
        arr[y] = arr[x]^arr[y];
        arr[x] = arr[x]^arr[y];
    }
}
